Skip to content

Improve LCMS alignment initialization performance - #770

Merged
YukiMatsuzawa merged 2 commits into
masterfrom
improve-lcms-alignment-performance
Aug 17, 2026
Merged

Improve LCMS alignment initialization performance#770
YukiMatsuzawa merged 2 commits into
masterfrom
improve-lcms-alignment-performance

Conversation

@YukiMatsuzawa

Copy link
Copy Markdown
Contributor

Why

Reduce unnecessary initialization cost in LCMS-related workflows, especially when identification is not requested and when MS-FINDER databases are not used immediately.

What changed

  • Construct LCMS, LC-IM-MS, and DIMS annotation processes only inside the Identification execution path.
  • Lazily load MS-FINDER product ion, neutral loss, formula, structure, ontology, and EI fragment databases on first use.
  • Route all MS-FINDER database consumers through the lazy-loading properties.

Notes

The alignment algorithm itself is unchanged. The lazy database loading is scoped to each InternalMsfinderSettingModel instance, so loaded databases are released with that model rather than kept in a global cache.

YukiMatsuzawa and others added 2 commits August 7, 2026 13:45
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces upfront initialization overhead in LCMS-related workflows by deferring construction of annotation processes until identification is actually requested, and by lazily loading MS-FINDER databases only when they’re first needed.

Changes:

  • Move LCMS / LC-IM-MS / DIMS annotation process construction inside the ProcessOption.Identification execution path.
  • Convert MS-FINDER DB fields (product ion, neutral loss, formula, structure, ontology, EI fragment) into lazy-loaded, per-instance cached properties.
  • Update MS-FINDER DB consumers to use the lazy-loading properties.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/MSDIAL5/MsdialGuiApp/Model/Setting/InternalMsfinderSettingModel.cs Lazily loads MS-FINDER databases and routes formula/structure workflows through cached properties to avoid unnecessary startup cost.
src/MSDIAL5/MsdialGuiApp/Model/Lcms/LcmsMethodModel.cs Defers LCMS annotation process creation until identification runs.
src/MSDIAL5/MsdialGuiApp/Model/Lcimms/LcimmsMethodModel.cs Defers LC-IM-MS annotation process creation until identification runs.
src/MSDIAL5/MsdialGuiApp/Model/Dims/DimsMethodModel.cs Defers DIMS annotation process creation until identification runs.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +121 to 124
var userDefinedDbFilePath = _parameter.UserDefinedDbFilePath;
if (userDefinedDbFilePath == null || userDefinedDbFilePath == string.Empty) {
MessageBox.Show("Select your own structure database, or uncheck the user-defined database option.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
return;
@YukiMatsuzawa
YukiMatsuzawa merged commit 53db0d7 into master Aug 17, 2026
10 checks passed
@YukiMatsuzawa
YukiMatsuzawa deleted the improve-lcms-alignment-performance branch August 17, 2026 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants